home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 19 / develop 19 code / SimpliFace_V2 / Sources / SimpliFace2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-01  |  3.5 KB  |  130 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SimpliFace2.h
  3.  
  4.     Contains:    Interface for a simple Scriptable application.
  5.  
  6.  
  7.     Developed by:
  8.  
  9.     Paul G Smith (commstalk hq & Full Moon Software, Inc)
  10.  
  11.     you can leave messages at (UK): 0727 844232; (US): 408 253 7199
  12.     BUT I prefer to be contacted by e-mail
  13.     AppleLink:     COMMSTALK.HQ
  14.     Internet:     COMMSTALK.HQ@applelink.apple.com
  15.  
  16.     "SimpliFace2" Sample code to accompany develop article
  17.     on techniques for controlling script inheritance.
  18.     
  19.     
  20.  
  21.  
  22. */
  23.  
  24. #ifndef __SimpliFace2__
  25. #define __SimpliFace2__
  26.  
  27. #ifndef __APPLICATION__
  28. #include <Application.h>
  29. #endif
  30.  
  31. #ifndef __PASCALSTRING__
  32. #include "PascalString.h"
  33. #endif
  34.  
  35. #ifndef __LISTOFLONGS__
  36. #include "ListOfLongs.h"
  37. #endif
  38.  
  39. /**********************************************************************
  40. ** class TSimpliFace2
  41. ***********************************************************************/
  42.  
  43. class TSimpliFace2 : public TApplication {
  44. public:
  45.                                 TSimpliFace2(Ptr qdPtr);
  46.     virtual                        ~TSimpliFace2();
  47.  
  48.     virtual    void                DoIdle();
  49.     virtual    void                AdjustMenus();
  50.     virtual    void                AdjustCursor();
  51.     virtual    void                DoMenuCommand(short menuID, short menuItem);
  52.     virtual    void                Terminate();
  53.  
  54.     virtual void                 DoActivateEvt();    
  55.     virtual void                 DoUpdateEvt();
  56.     virtual void                 DoGoAway();
  57.  
  58.     virtual    void                GetThisAppName(CStr255& appName);
  59.     
  60.     virtual Boolean             HandleContentClick (AEDesc *target, 
  61.                                             WindowPtr tWind, EventRecord& theEvent);
  62.     virtual Boolean             HandleGoAway (AEDesc *target, 
  63.                                             WindowPtr tWind);
  64.     virtual Boolean             HandleMenuCommand (AEDesc *target, 
  65.                                             short menuNum, short itemNum);
  66.     virtual Boolean             HandleMouseDown (AEDesc *target, 
  67.                                             EventRecord& theEvent);
  68.     virtual Boolean             HandleKeyDown (AEDesc *target, 
  69.                                             EventRecord& theEvent);
  70.     virtual Boolean             HandleEvent (EventRecord& theEvent, Boolean& pass);
  71.     // returns true if event was handled by aevt pre-handler
  72.     
  73.     virtual OSErr                CollectAETEs(short languageCode, AEDesc& resultDesc);
  74.     
  75.     virtual void                 SetUp();        // Run before event loop starts
  76.     virtual void                 CleanUp();        // run at end of loop
  77.     
  78.     // Returns total stack space required in bytes.
  79.     virtual long                 StackNeeded();
  80.     
  81.     // Returns total heap space required in bytes.
  82.     virtual long                 HeapNeeded();
  83.  
  84.     virtual unsigned long         SleepVal();        // how long to sleep in WaitNextEvent
  85.     
  86.     // AE object model support
  87.                                         
  88.     virtual  OSErr CountElements (DescType desiredClass,
  89.                                         long *result);
  90.                                         
  91.     virtual  OSErr ResolveContainer    (TScriptableObject **theContainerObj);
  92.  
  93.     virtual  OSErr ResolveElementByName(DescType desiredClass,
  94.                                         CStr255& nameStr,
  95.                                         TScriptableObject **theResultObj);
  96.                                         
  97.     virtual  OSErr ResolveElementByIndex(DescType desiredClass,
  98.                                         short theIndex,
  99.                                         TScriptableObject **theResultObj);
  100.     
  101.     virtual  OSErr GetProperty  (DescType propertyID, DescType wantType, AEDesc *result);
  102.  
  103.     virtual  OSErr SetProperty  (DescType propertyID, const AEDesc *theData);
  104.  
  105.     virtual     OSErr CreateNewElement    (DescType desiredClass,
  106.                                         DescType position,
  107.                                         AEDesc *theData,
  108.                                         AERecord *theProperties,
  109.                                         TScriptableObject *theContainerObj,
  110.                                         TScriptableObject **theNewObj);
  111.  
  112.                                         
  113.     virtual  OSErr GetTargetObjectSpecifier  (EventRecord& theEvent, AEDesc *result);
  114.  
  115.     virtual     void    FixUpScriptReferences(TScriptableObject* theParent);
  116.     
  117. private:
  118.     TListOfLongs        fWindowObjects;
  119. };
  120.  
  121. /*    -----------------------------------------------------------------
  122.     inline methods
  123.     ----------------------------------------------------------------- */
  124.  
  125.  
  126. extern    TSimpliFace2*    gSimpliFace2;
  127.  
  128.  
  129. #endif
  130.